package com.kefu.robot.vo;

import javax.validation.constraints.NotEmpty;

import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractUpdateVo;
import com.kefu.robot.model.RobotAidataDocType;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author xiaoyu
 * @date 2023/11/03
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "AI模型词条分类表")
public class RobotAidataDocTypeUpdateVo extends AbstractUpdateVo<RobotAidataDocType, String> {

    @NotEmpty
    @ApiModelProperty(value = "主键", required = true)
    private String docTypeId;
    @ApiModelProperty(value = "分类名称")
    private String name;


    @Override
    public RobotAidataDocType convert() {
        RobotAidataDocType info = BeanUtil.toBean(this, RobotAidataDocType.class);
        KefuContext context = KefuContext.getKefuContext();
        info.setUpdateUser(context.getUserId());
        info.setUpdateTime(context.getNow());
        return info;
    }
}